//Wrapper for EE::Sun
#pragma once
#include "stdafx.h"

namespace EsenthelNet
{
	public enum class SunRaysMode {
		///<summary>Disabled</summary>
		SUN_RAYS_OFF ,  
		///<summary>Enabled with object occlusion detection</summary>
		SUN_RAYS_LOW ,  
		///<summary>Enabled with object+clouds occlusion detection</summary>
		SUN_RAYS_HIGH 
	};

	///<summary>Astronomical Object (Star/Planet/Moon)</summary>
	public ref class Astro {
	internal:
		Astro(EE::Astro a) {
			astro = new EE::Astro();
			*astro = a;
		}
		Astro(EE::Astro* a) {
			astro = a;
		}
		EE::Astro* astro;
	public:
		Astro() {
			//astro = new EE::Astro();
			astro = &EE::Astros.New();
		}
		~Astro() { delete astro; astro = NULL; }

		///<summary>If use this object in drawing, true/false, default=true</summary>
		Prop(bool, Draw, astro->draw)
		///<summary>If use blending for image, true/false, default=true, if true then 'image' will be applied using alpha blending, if false 'image' will be added onto the screen</summary>
		Prop(bool, Blend, astro->blend)
		///<summary>Glow amount, 0..255, default=0, total glow amount is equal to ('image' alpha channel * 'image_color' alpha component * 'glow')</summary>
		Prop(System::Byte, Glow, astro->glow)
		///<summary>Image size, 0..1, default=0.15</summary>
		Prop(float, Size, astro->size)
		///<summary>Normalized position, position on sky sphere radius=1, default=!Vec(-1,1,-1)</summary>
		PropVecP(Pos, astro->pos)
		///<summary>Image color, default=WHITE</summary>
		property EsenthelNet::Color^ ImageColor { EsenthelNet::Color^ get() { return gcnew EsenthelNet::Color(&astro->image_color); } void set(EsenthelNet::Color^ col) { astro->image_color = *col->color; }}
		///<summary>Image, default=NULL</summary>
		PropImage(Image, astro->image)

		///<summary>Light color, (0,0,0)..(1,1,1), default=(0,0,0), value of (0,0,0) disables light casting</summary>
		PropVecP(LightColor, astro->light_color)
		///<summary>Volumetric amount,0..Inf, default=0.2</summary>
		Prop(float, VolumentricAmount, astro->light_vol)
		///<summary>Volumetric exponent, 0..Inf, default=1.0</summary>
		Prop(float, VolumentricExponent, astro->light_vol_exp)
		///<summary>Volumetric steam, 0..1, default=0.5</summary>
		Prop(float, VolumentricSteam, astro->light_vol_steam)

		///<summary>Container of astronomical objects</summary>
		static property System::Collections::Generic::List<EsenthelNet::Astro^>^ Astros { System::Collections::Generic::List<EsenthelNet::Astro^>^ get() { ToList(EsenthelNet::Astro, EE::Astros) return list;} }
		///<summary>If draw astronomical objects, default=true</summary>
		static Prop(bool, AstrosDraw, EE::AstrosDraw)

	};

	///<summary>Sun objects have default member values: 'glow'=128, 'light_color'=(0.7,0.7,0.7)</summary>
	public ref class SunClass : EsenthelNet::Astro {
	internal:
		SunClass(EE::SunClass s) {
			astro = new EE::SunClass();
			*astro = s;
		}
		SunClass(EE::SunClass* s) {
			astro = s;
		}
	public:
		SunClass() {
			astro = &Sun;
		}

		///<summary>Amount of highlight applied on atmospheric sky, 0..Inf, default=0.10</summary>
		Prop(float, HighlightFront, ((EE::SunClass*)astro)->highlight_front)
		///<summary>Amount of highlight applied on atmospheric sky, 0..Inf, default=0.07</summary>
		Prop(float, HighlightBack, ((EE::SunClass*)astro)->highlight_back)

		///<summary>Rays mode, SUN_RAYS_MODE, default=SUN_RAYS_HIGH</summary>
		PropTarget(EsenthelNet::SunRaysMode, RaysMode, ((EE::SunClass*)astro)->rays_mode, SUN_RAYS_MODE)
		///<summary>Rays softing, true/false, default=false</summary>
		Prop(bool, RaysSoft, ((EE::SunClass*)astro)->rays_soft)
		///<summary>Rays resolution, 0..2, default=0, bigger value means bigger resolution and slower performance, resolution #2 can't be softened</summary>
		Prop(System::Byte, RaysRes, ((EE::SunClass*)astro)->rays_res)
		///<summary>Rays color, (0,0,0)..(1,1,1), default=(0.1,0.1,0.1)</summary>
		PropVecP(RaysColor, ((EE::SunClass*)astro)->rays_color)
	};

}

